package cate.common.table.item.rune.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.util.random.RWItem;
import easy.java.dev.note.NoteField;

public class RuneAttrRow extends ERow implements RWItem {
    @NoteField(value = "属性id")
    public int tid;

    @NoteField(value = "属性")
    public String attrStr;

    @NoteField(value = "原型ID")
    public int protoId;

    @NoteField(value = "权重")
    public double weight;

    @NoteField(value = "所属属性组")
    public int groupId;

    @NoteField(value = "是否最大值")
    public boolean isMaxValue;

    @Override
    public void parse(XSSFRowWrap xr) {
        this.id = xr.getInteger("ID", -1);
        this.tid = xr.getInteger("ID", -1);
        this.attrStr = xr.getString("属性");
        this.protoId = xr.getInteger("原型ID", 0);
        this.weight = xr.getDouble("权重", 1.0);
        this.groupId = xr.getInteger("所属属性组", -1);
        this.isMaxValue = xr.getBoolean("是否最大值", false);
    }

    @Override
    public double getWeight() {
        return weight;
    }
}
